import Vue from 'vue'
import VueRouter from 'vue-router'
import Main from '../views/Main.vue'
import Sport from '../views/Sport.vue'
import News from '../views/News.vue'
import NotFount from '../views/NotFount.vue'
import SportMain from '../views/Child/SportMain.vue'
import ChinaSport from '../views/Child/ChinaSport.vue'
import OtherSport from '../views/Child/OtherSport.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/main'
  },
  {
    path: '/main',
    name: 'Main',
    component: Main
  },
  {
    path: '/sport',
    name: 'Sport',
    component: Sport,
    redirect:'/sport/sportmain',
    children: [
      {
        path: 'sportmain',
        component:SportMain
      },
      {
        path: 'chinasport',
        component:ChinaSport
      },
      {
        path: 'othersport',
        component:OtherSport
      },
    ]
  },
  {
    path: '/news',
    name: 'News',
    component: News
  },
  {
    path: '*',
    component:NotFount
  }
]

const router = new VueRouter({
  routes
})

export default router
